<template>
  <div class="box">
    <img :src="globalInfo.coverImgUrl" alt="">
    <div class="count">
      <i class="iconfont iconbofang"/>
      <span class="playCount">{{globalInfo.playCount}}</span>
    </div>
    <div class="bofang"/>
    <i class="iconfont icon65zanting"/>
  </div>
  <span class="global-name">{{globalInfo.name}}</span>
</template>

<script lang="ts">
export default {
  name: 'global',
  props: {
    globalInfo: {
      type: Object,
      default: () => ({})
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  position: relative;
  width: 100%;
  border-radius: 5px;
  color: #f2f3f4;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 10px;

  >img {
    width: 100%;
    border-radius: 5px
  }

  .count {
    position: absolute;
    top: 8px;
    right: 5px;
    display: flex;
    align-items: center;

    >i {
      font-size: 18px;
    }
  }

  .bofang {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 35px;
    width: 35px;
    line-height: 35px;
    border-radius: 50%;
    opacity: .9;
    background-color: #fff;

    &:hover {
      display: block;
    }
  }

  >i {
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #ec4141;
  }

  &:hover {

    .bofang {
      display: block;
    }

    >i {
      display: inline-block;
    }
  }
}

.global-name {
  cursor: pointer;
  font-size: 15px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-height: 1.4;
}
</style>
